#include<bits/stdc++.h>
using namespace std;

int a[100005];

int main() {
	int x;
	while (cin >> x) {
		if (x % 2) continue;
		a[x]++;
	}
	int ans = max_element(a + 1, a + 100001) - a;
	cout << (a[ans] ? ans : -1);
	return 0;
}
